<template>
  <div id="docx-container"></div>
</template>

<script setup>
import { onMounted } from 'vue'
import { previewOffice } from '@ebag/office-preview'

const props = defineProps({
  fileUrl: { type: String, default: '' }
})

onMounted(() => {
  previewOffice('docx-container', props.fileUrl).catch(err => {
    console.error('预览出错', err)
  })
})
</script>

<style lang="less" scoped>
#docx-container {
  position: relative;
  width: 1150px;
  height: 880px;
  background-color: #fff;
}
</style>
